from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_TSWD(AbstractInd):

    def get_name(self):
        return "CG_LT_GL_GL04_TSWD"

    def get_data_source(self):
        return "mysql"

    def get_sql(self, params) -> str:
        sql_TSWD = """    
                    SELECT
        	    syn_tq_rgaoluchutie.ftswd AS CG_LT_GL_GL04_TSWD,
        	    syn_tq_rgaoluchutie.fdatetime
                from	
                syn_tq_rgaoluchutie
                where syn_tq_rgaoluchutie.ftswd NOT LIKE '%#%'
                and syn_tq_rgaoluchutie.fdatetime > DATE_SUB(CURTIME(), INTERVAL 24 hour) 
                order by  fdatetime desc       
                """.format(**params)
        return sql_TSWD
